The present invention relates generally to a routine executing method in a database system, and more particularly to a routine executing method suitable for parallel processing of queries in a relational database management system.
Conventionally, relational database systems, particularly SQL database systems, have been increasingly applied mainly to data processing for business.
The earlier SQL specifications have been so configured as to instruct a database server to individually execute one by one database operations such as search, update, insert, delete and so on of data.
The current SQL specifications, on the other hand, provide instructions for substitution and control such as IF, WHILE and so on, in addition to the above-mentioned instructions for database operations, and can collectively define a series of processing in the form of a procedure or a function with an appropriate name given thereto. Here, the procedure and the function are collectively referred to as a "routine."
As a draft of standardization for currently standardized SQL3, there is ISO/IEC JTC1/SC21/WG3 DBL-MCI-004, ISO Working Draft Database Language SQL, 1996.
A server for accessing a database in a database management system receives a request issued during the execution of a user application from a client, accesses the database, and returns a result. Also, in a relational database system, data can be readily divided and positioned into a plurality of database processing servers such that the plurality of database processing servers can parallelly access the divided data to improve the performance of the overall relational database system.
A need for such parallel database systems has been becoming higher with an increase in the amount of data. An exemplary parallel database system is described in D. DeWitt, et. al., "Parallel Database Systems: The Future of High Performance Database Systems", CACM, Vol. 35, No. 6, 1992.
A conventional parallel database system comprises a server (hereinafter referred to as the "front end server") which has a function of analyzing and compiling a query from a user application program (hereinafter abbreviated as "UAP") in a client and a function of totalizing the results of executing the query for divided data positioned in a plurality of parallel processing servers to return the totalized results to the client; and a plurality of servers (each of which is hereinafter referred to as the "database operation server"), each of which has a function of accessing a disk drive, which stores data, for performing required operations on the data. In general, the front end server and the database operation servers are interconnected through a high speed interconnection network.
For configuring a parallel data processing scheme, servers may be allocated on a function basis to achieve a pipeline-type parallel structure, other than the above-mentioned one which allocates divided data to a plurality of servers. In this case, execution process instructions are created for each server function, and the parallel processing is realized by executing each execution process in a multi-thread form.
In a parallel database system, as the division of data and respective functions are parallelly executed as mentioned above, communications are performed between associated functions for transmitting and receiving data flows through pipelines and for other processing. Therefore, the parallel database system has a challenge to reduce a load caused by the communications.
Next, description is made on the execution of a procedure in a parallel database system as a prior art technique. A procedure is defined by a CREATE PROCEDURE statement. In SQL3, a user-defined type, referred to as Abstract Data Type (ADT), can be defined, and another procedure may also be defined in a definition statement for the abstract data type.
A definition statement for a procedure is analyzed by the front end server which creates internal type codes (hereinafter referred to as an "execution process instruction") corresponding to a processing method and process. The execution process instruction may be codes interpreted by an interpreter or codes of execution type. The execution process instruction is registered as dictionary information related to the procedure.
For calling a procedure, a CALL statement is provided for calling a SQL statement from an application program written in a high class language such as C language. The CALL statement is analyzed by the front end server which retrieves execution process instructions corresponding to a procedure name and arguments written in the CALL statement from the dictionary information and executes the retrieved execution process instructions.
If processing described in a procedure includes a database operation such as search, update, insert and deletion of data (hereinafter update, insert and delete queries are collectively referred to as the "update-related queries"), execution process instructions for performing the database operation are provided for the front end server as well as for the database operation servers which have data to be operated.
Each of the database operation servers operates divided data allocated thereto in accordance with execution process instructions provided thereto. The front end server in turn executes execution process instructions for totalizing the results of database operations performed by the respective database operation servers.
As an example, if a database is searched for certain data, the respective database operation servers search for the data, transfer retrieved data to the front end server which sequentially receives and uses the data transferred thereto.
If a dedicated database operation server is provided for high load processing such as sorting or the like, execution process instructions are created likewise for this database operation server.